<?
class HomeTopForm extends Form
{
    function __construct(){
        Form::Form('HomeTopForm');
        $this->link_css('style/jquery-ui-1.9.2.custom.css');
        $this->link_css('style/front-banner-slide.css');
        $this->link_js('javascript/jquery/jquery-ui-1.9.2.custom.min.js');
        $this->link_js('javascript/jquery.tinycarousel.js');
    }
    function draw(){
        global $display;
        $limit = 'LIMIT 0,5';
        $condition = '(status = 1)';
        Db_Location::get_cities();
        $hotels = Db_Hotel::getHotelsForHome($limit,$condition);
        $city = array();
        $imgsDefault = array();
        foreach($hotels as $h){
            $imgsDefault[] =$h['image_default'];
                $city[]=Db_Location::getCityNotDistrict($h['city_id']);
        }
        $imgsDefault = join(',',$imgsDefault);
        if($imgsDefault){
            $imgs =Db_Image::selectImages('id, img_name, img_url, img_server', '', "id IN ($imgsDefault)");
            $display->add('imgs',$imgs);
        }
        $display->add('hotels', $hotels);
        $display->add('city',$city);
        $display->output('default');
    }
    
    /************************************************
     * Submit đăng nhập user
     ************************************************
     */
    function on_submit(){
        
    }
}
?>